﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Trukuxzo.Samples.Creational.Patterns.Singleton;
using Trukuxzo.Samples.Creational.Patterns.Client;

namespace Trukuxzo.Samples.Creational.Patterns
{
    class Program
    {
        static void Main(string[] args)
        {
            RunCreationalPatterns(TypeCreationalPatterns.AbstractFactory);
            Console.ReadKey();
            
        }

        private static void RunCreationalPatterns(TypeCreationalPatterns typeEnum)
        {
            switch (typeEnum)
            {
                case TypeCreationalPatterns.FactoryMethod:
                    break;
                case TypeCreationalPatterns.AbstractFactory:
                    Console.WriteLine("************Abstract Factory for 64bits************" + Environment.NewLine);

                    AbstractFactoryClient browser64 = new AbstractFactoryClient();
                    browser64.ImportBookmark64bits();

                    Console.WriteLine("************Abstract Factory for 32bits************" + Environment.NewLine);

                    AbstractFactoryClient browser32 = new AbstractFactoryClient();
                    browser32.ImportBookmark32bits();

                    break;
                case TypeCreationalPatterns.Singleton:
                    for (int i = 0; i < 20; i++)
                    {
                        Console.WriteLine("Next singleton value: {0}",
                            SingletonClient.GetNextValue());
                    }

                    break;
                default:
                    break;
            }
        }
    }

    public enum TypeCreationalPatterns
    {
        FactoryMethod = 1,
        AbstractFactory = 2,
        Singleton = 3
    }
}
